from django.db import models

# Create your models here.
from category.models import Category

class App(models.Model):
    name = models.CharField(max_length=100, verbose_name="应用名称")
    url = models.URLField(verbose_name="应用URL")
    category = models.ForeignKey(Category, on_delete=models.CASCADE, related_name="apps", verbose_name="所属子分类")
    created_at = models.DateTimeField(auto_now_add=True, verbose_name="创建时间")
    updated_at = models.DateTimeField(auto_now=True, verbose_name="更新时间")

    def __str__(self):
        return self.name